package com.heima.boot.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * 消费者监听对象
 */
@Component
@Slf4j
public class ConsumerListener {


    @KafkaListener(topics ={"topic_kafka_end"} )
    public void getMessage(ConsumerRecord<String,String> consumerRecord){
       log.info("当前消息的key:{},消息的value:{}",consumerRecord.key(),consumerRecord.value());
    }
}
